import json


def resolveJson(path):
    file = open(path, "rb")
    fileJson = json.load(file)
    field = fileJson["login"]
    # print(field)
    # futures = fileJson["futures"]
    # type = fileJson["type"]
    # name = fileJson["name"]
    # time = fileJson["time"]

    return (field)


def output():
    result = resolveJson(path)
    # print(result)
    for x in result:
        for y in x:
            print(y)
def write_json():
    token="1212"
    data={"login": {"password21": "123456","systemType":"1","mobile":"13955231435","src":"mobile"},
  "token": {"Content-type":"application/json","Authorization":token}}
    with open(path,"w") as f:
        json.dump(data,f)
def test_json():
    path =r"tets.json"
    with open(path,'r') as fr:
        json_all=json.load(fr)
        json_all['token']['Authorization']="te32211tokenooo88800"
        with open(path,"w") as fw :
            json.dump(json_all,fw,ensure_ascii=False,indent=4)


path = r"tets.json"
test_json()
# write_json()
# output()